<template>
	<view class="page">
		<template v-if="isLogin">
			<view class="category-list row-2">
				<!-- <navigator url="/package_yunshangbao/form/form" open-type="navigate" hover-class="none" class="item">
					<view class="icon"><image src="@/static/images/jl_pc.png" mode="widthFix"></image></view>
					<view class="text">上报数据</view>
				</navigator> -->
				<navigator :url="'/package_yunshangbao/list/list?type='+userAuth.ysb_type" open-type="navigate" hover-class="none" class="item">
					<view class="icon"><image src="@/static/images/ysb_datas.png" mode="widthFix"></image></view>
					<view class="text">上报记录</view>
				</navigator> 
			</view>
			<view class="start-btn-area">
				<navigator :url="'/package_yunshangbao/form/form?type='+userAuth.ysb_type" hover-class="none" class="btn">
					<image src="@/static/images/sb_start.png" mode="widthFix"></image>
				</navigator>
				<view class="name"><text>红火蚁云上报</text></view>
			</view>
			 
		</template>
	</view>
</template>

<script>
	import {
		HTTP_OLD_HOST,
		WEB_HOST
	} from '@/config.js'
	
	export default {
		name: 'name',
		data() {
			return { 
				isLogin: false, 
				userInfo: uni.getStorageSync('userInfo'),
				loginStateUpdate: false,
				app_name: getApp().globalData.app_name, 
				userAuth:{}

			}


		},
		async onLoad() {			
			this.isLogin=await this.$loginState('check'); 
			if(this.isLogin){
				this.userAuth=await this.getUserAuth();
			}
		},
		async onShow() { 
		},
		methods: { 
			// 获取用户权限信息
			getUserAuth:async function(){
				let res=await this.$api.user_api.getUserInfo({
					ret_type:1
				});  
				if(res.data.ret==0){  
					res.data.data.alltype=res.data.data.alltype.split(','); 
					return res.data.data;					 
				}				
			},
		},
		components: {

		},

		computed: {

		},
		watch: {

		}

	}
</script>

<style lang="less" scoped> 
	.category-list{
		background: #fff;
		margin-bottom: 20rpx;
		padding: 20rpx 0 0;
		.item{
			.icon{
				width: 30%!important;
			}
		}
	}
	.name {
		text-align: center;

		text {
			padding-top: 10rpx;
			border-top: 2rpx dashed #999;
			font-size: 28rpx;
			color: #999;
		}
	}
	
	.start-btn-area{
		position:absolute;
		left:0;
		bottom:150rpx;
		width:100%;
	}

	.btn {
		width: 60%;
		margin: 0 auto;

		image {
			width: 100%;
		}
	}
	
	
</style>
